/**
 * @this FormSubmitHOC: hook 提交按钮
 *
 * @flow
 *
 * 可以移植的 Form
 */

import React, { Component } from 'react'
import PropTypes from 'prop-types'

export default (WrappedComponent) => {
  return class PackComponent extends Component {
    static propTypes = {
      onPress: PropTypes.func,
      submitButton: PropTypes.bool,
    }

    static defaultProps = {
      onPress: () => {},
      submitButton: true,
    }

    render() {
      return (
        <WrappedComponent {...this.props} />
      )
    }
  }
}